# include "array-list.h"

int * get (int a) {
	int *c = (int *) malloc(sizeof(int));
	*c = a;
	return c;
}

int func (void *c, void *d) {
	int *a = c;
	int *b = d;
	if (*a > *b) return 1;
	if (*a < *b) return -1;
	return 0;
}

int main () {
	ArrayList *lst = NULL;
	int i,n=10;
	lst = newArrayList(3);
	for (i=0;i<n;i++) arrayInsert(lst,get(i));
	arraySort(lst,func,1);
	int *a;
	n = arrayGetLength(lst);
	for (i=0;i<n;i++) {
		a = arrayGet(lst,i);
		printf("%d\n",*a);
	}
	return 0;
}
